package arith;

import java.util.Random;

public class MultOperation implements Operation {
	
	private Problem prob = null;
	
	public MultOperation(char a, char b){
		prob = new Problem("" + a + " * " + b);
	}
	
	public MultOperation(Problem prob1, Problem prob2){
		prob = new Problem("("+prob1.getTemplate()+") * ("+prob2.getTemplate()+")");
	}
	
	public MultOperation(Problem prob1, char a){
		Random randomGenerator = new Random();
		int r = randomGenerator.nextInt(2);
		if(r == 0){
			prob = new Problem("("+prob1.getTemplate()+") * "+a);
		}else{
			prob = new Problem(""+a+" * ("+prob1.getTemplate()+")");
		}
	}

	public Problem getProblem() {
		return prob;
	}
}